package com.zhz.livegoods.buytime.service.impl;

import com.zhz.livegoods.buytime.mapper.ItemMapper;
import com.zhz.livegoods.buytime.service.BuytimeService;
import com.zhz.livegoods.commons.vo.LivegoodsResult;
import com.zhz.livegoods.pojo.Item;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 查询商品预订倒计时服务实现
 * @author zhz
 * @date 2020/08/06
 **/
@Service
public class BuytimeServiceImpl implements BuytimeService {
    @Autowired
    private ItemMapper itemMapper;
    @Override
    public LivegoodsResult getBuytimeById(String id) {
        Item item = itemMapper.findById(id);
        LivegoodsResult result = LivegoodsResult.ok();
        result.setTime(item.getBuytime().getTime());
        return result;
    }
}
